<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>uartps: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">uartps
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('index.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">uartps Documentation</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This driver supports the following features:- Dynamic data format (baud rate, data bits, stop bits, parity)</p><ul>
<li>Polled mode</li>
<li>Interrupt driven mode</li>
<li>Transmit and receive FIFOs (32 byte FIFO depth)</li>
<li>Access to the external modem control lines</li>
</ul>
<p><b>Initialization &amp; Configuration</b></p>
<p>The <a class="el" href="struct_x_uart_ps___config.html" title="This typedef contains configuration information for the device. ">XUartPs_Config</a> structure is used by the driver to configure itself. Fields inside this structure are properties of <a class="el" href="struct_x_uart_ps.html" title="The XUartPs driver instance data structure. ">XUartPs</a> based on its hardware build.</p>
<p>To support multiple runtime loading and initialization strategies employed by various operating systems, the driver instance can be initialized in the following way:</p>
<ul>
<li>XUartPs_CfgInitialize(InstancePtr, CfgPtr, EffectiveAddr) - Uses a configuration structure provided by the caller. If running in a system with address translation, the parameter EffectiveAddr should be the virtual address.</li>
</ul>
<p><b>Baud Rate</b></p>
<p>The UART has an internal baud rate generator, which furnishes the baud rate clock for both the receiver and the transmitter. Ther input clock frequency can be either the master clock or the master clock divided by 8, configured through the mode register.</p>
<p>Accompanied with the baud rate divider register, the baud rate is determined by: </p><pre>
      baud_rate = input_clock / (bgen * (bdiv + 1)
</pre><p> where bgen is the value of the baud rate generator, and bdiv is the value of baud rate divider.</p>
<p><b>Interrupts</b></p>
<p>The FIFOs are not flushed when the driver is initialized, but a function is provided to allow the user to reset the FIFOs if desired.</p>
<p>The driver defaults to no interrupts at initialization such that interrupts must be enabled if desired. An interrupt is generated for one of the following conditions.</p>
<ul>
<li>A change in the modem signals</li>
<li>Data in the receive FIFO for a configuable time without receiver activity</li>
<li>A parity error</li>
<li>A framing error</li>
<li>An overrun error</li>
<li>Transmit FIFO is full</li>
<li>Transmit FIFO is empty</li>
<li>Receive FIFO is full</li>
<li>Receive FIFO is empty</li>
<li>Data in the receive FIFO equal to the receive threshold</li>
</ul>
<p>The application can control which interrupts are enabled using the <a class="el" href="group__uartps__v3__1.html#gab3b65e926f6f4ac7ab41a70801ba12c3" title="This function sets the interrupt mask. ">XUartPs_SetInterruptMask()</a> function.</p>
<p>In order to use interrupts, it is necessary for the user to connect the driver interrupt handler, <a class="el" href="group__uartps__v3__1.html#gabf86fb20a58e4a7fbd73afa49f8eb604" title="This function is the interrupt handler for the driver. ">XUartPs_InterruptHandler()</a>, to the interrupt system of the application. A separate handler should be provided by the application to communicate with the interrupt system, and conduct application specific interrupt handling. An application registers its own handler through the <a class="el" href="group__uartps__v3__1.html#ga9528098e589491997c7805592a4b5a7b" title="This function sets the handler that will be called when an event (interrupt) occurs that needs applic...">XUartPs_SetHandler()</a> function.</p>
<p><b>Data Transfer</b></p>
<p>The functions, <a class="el" href="group__uartps__v3__1.html#ga17b3e12a296eecf17be4a4b8583576e7" title="This functions sends the specified buffer using the device in either polled or interrupt driven mode...">XUartPs_Send()</a> and <a class="el" href="group__uartps__v3__1.html#gadc16932076b99cd747e702dcbecd102b" title="This function attempts to receive a specified number of bytes of data from the device and store it in...">XUartPs_Recv()</a>, are provided in the driver to allow data to be sent and received. They can be used in either polled or interrupt mode.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>The default configuration for the UART after initialization is:</p>
<ul>
<li>9,600 bps or XPAR_DFT_BAUDRATE if defined</li>
<li>8 data bits</li>
<li>1 stop bit</li>
<li>no parity</li>
<li>FIFO's are enabled with a receive threshold of 8 bytes</li>
<li>The RX timeout is enabled with a timeout of 1 (4 char times)</li>
</ul>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who    Date       Changes
<hr/>

1.00a   drg/jz 01/12/10 First Release
1.00a sdm    09/27/11 Fixed compiler warnings and also a bug
                in XUartPs_SetFlowDelay where the value was not
                being written to the register.
1.01a sdm    12/20/11 Removed the InputClockHz parameter from the <a class="el" href="struct_x_uart_ps.html" title="The XUartPs driver instance data structure. ">XUartPs</a>
                instance structure and the driver is updated to use
                InputClockHz parameter from the <a class="el" href="struct_x_uart_ps___config.html" title="This typedef contains configuration information for the device. ">XUartPs_Config</a> config
                structure.
                Added a parameter to <a class="el" href="struct_x_uart_ps___config.html" title="This typedef contains configuration information for the device. ">XUartPs_Config</a> structure which
                specifies whether the user has selected Modem pins
                to be connected to MIO or FMIO.
                Added the tcl file to generate the xparameters.h
1.02a sg     05/16/12   Changed XUARTPS_RXWM_MASK to 0x3F for CR 652540 fix.
1.03a sg     07/16/12 Updated XUARTPS_FORMAT_7_BITS and XUARTPS_FORMAT_6_BITS
                with the correct values for CR 666724
                        Added defines for XUARTPS_IXR_TOVR,  XUARTPS_IXR_TNFUL
                and XUARTPS_IXR_TTRIG.
                Modified the name of these defines
                XUARTPS_MEDEMSR_DCDX to XUARTPS_MODEMSR_DDCD
                XUARTPS_MEDEMSR_RIX to XUARTPS_MODEMSR_TERI
                XUARTPS_MEDEMSR_DSRX to XUARTPS_MODEMSR_DDSR
                XUARTPS_MEDEMSR_CTSX to XUARTPS_MODEMSR_DCTS
1.05a hk     08/22/13 Added API for uart reset and related
                constant definitions.
2.0   hk      03/07/14 Version number revised.
2.1   hk     04/16/14 Change XUARTPS_MAX_RATE to 921600. CR# 780625.
2.2   hk     06/23/14 SW reset of RX and TX should be done when changing
                      baud rate. CR# 804281.
3.0   vm     12/09/14 Modified source code according to misrac guideline.
                Support for Zynq Ultrascale Mp added.
3.1     kvn    04/10/15 Modified code for latest RTL changes. Also added
                                        platform variable in driver instance structure.
3.1   adk   14/03/16  Include interrupt examples in the peripheral test when
                uart is connected to a valid interrupt controller CR#946803.
3.2   rk     07/20/16 Modified the logic for transmission break bit set
3.4   ms     01/23/17 Added xil_printf statement in main function for all
                      examples to ensure that "Successfully ran" and "Failed"
                      strings are available in all examples. This is a fix
                      for CR-965028.
      ms     03/17/17 Added readme.txt file in examples folder for doxygen
                      generation.</pre><pre></pre> </div></div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
